<template>
	<view>
		<u-popup :round="10" :show="show" :safeAreaInsetBottom="false" mode="center" @close="close">

			<view class="loginoutPop">
				<image src="../../pages-sub/static/images/common/ailoading.gif"
					style="width: 300rpx; height: 300rpx; position: absolute; bottom: 318rpx;" mode="aspectFit">
				</image>
				<view class="title">{{title}}</view>
				<view class="desc">
					<slot></slot>
				</view>
				<view class="loginoutBtn">
					<view class="btn cancel" @click="cancel">{{cancelText}}</view>
					<view class="btn confirm" @click="confirm">{{confirmText}}</view>
				</view>
				<image src="../../pages-sub/static/images/common/close.png"
					style="width: 48rpx; height: 48rpx; position: absolute; bottom: -80rpx;" @click="close">
				</image>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		name: "rf-payAlert",
		props: {
			show: {
				type: Boolean,
				required: true,
				default: false,
			},
			title: {
				type: String,
				required: true,
				default: ""
			},
			desc: {
				type: String,
				required: true,
				default: ""
			},
			cancelText: {
				type: String,
				required: true,
				default: "取消"
			},
			confirmText: {
				type: String,
				required: true,
				default: "确定"
			}
		},
		data() {
			return {
				confirmShow: false,
			};
		},
		watch: {
			show(val) {
				console.log("----=-=-=-=-");
				console.log(val);
			},

		},
		methods: {
			confirm() {
				this.$emit('confirm')
				this.$emit('close')
			},
			cancel() {
				this.$emit('cancel')
				this.$emit('close')
			},
			close() {
				console.log("close");
				this.$emit('close')
			}
		}
	}
</script>

<style lang="scss">
	.loginoutPop {
		width: 480rpx;
		height: 404rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
		font-size: 28rpx;
		z-index: 999;

		.title {
			margin-top: 104rpx;
			font-size: 32rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			color: #3A3D4B;
			line-height: 44rpx;
		}

		.desc {

			margin: 20rpx 40rpx;
			font-size: 28rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #3A3D4B;
			line-height: 40rpx;
			text-align: center;

			.red {
				color: #FF5B2D;
			}
		}

		.loginoutBtn {
			display: flex;
			margin-bottom: 36rpx;

			.btn {
				width: 200rpx;
				height: 72rpx;
				// background: #FFFFFF;
				color: #fff;
				border-radius: 36rpx;
				text-align: center;
				line-height: 72rpx;
				margin: 0 10rpx;
			}

			.cancel {
				background-color: #FFA930;
			}

			.confirm {
				background-color: #58C866;

			}
		}
	}
</style>